package vn.com.tiz.DocumentZ.task;

import java.net.URLEncoder;


public class GetCarrier extends Supporter{
	CarrierResultData result = null;
	String text = null;
	
	public GetCarrier(int argAppId) {
		super(argAppId);
	}

	public CarrierResultData doRequest() {
//		if (!updateTelephonyData() && getTelephonyError() != SppResultCode.UnsetMailAddress) {
//			return new CarrierResultData(getTelephonyError());
//		}
		StringBuffer url = new StringBuffer();
		//url.append(CommonConsts.SPP_PATH_GETCARRIER);

		url.append("?AppId=");
		url.append(appId);
		url.append("&ICCID=");
		//url.append(URLEncoder.encode(getIccId()));
		url.append("&Model=");
		//url.append(URLEncoder.encode("DM009SH"));
		url.append(URLEncoder.encode(android.os.Build.MODEL));
		
		//Log.e("TrungTT",""+url);
		//String xml = sendSafety(url.toString(), null);
		
		
//		if (xml == null) {
//			result = new CarrierResultData(SppResultCode.NetworkError);
//		} else {
//			if (parse(xml)) {
//				result = new CarrierResultData(resultCode, errCode);
//				if (text != null)
//					result.carrier = Integer.parseInt(text);
//			} else {
//				result = new CarrierResultData(SppResultCode.Unknown);
//			}
//		}
		return result;
	}

	@Override
	protected boolean isUse(String tag) {
		if (tag.equals("CarrierID"))
			return true;
		return false;
	}

	@Override
	protected void putValue(String tag, String value) {
		if (tag.equals("CarrierID"))
			text = value;
	}
	
	
}
